﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ContentMigrator
{
    public partial class frmMain : Form
    {

        public frmMain()
        {
            InitializeComponent();
            StaticMethods.frmMainRef = this;
        }

        private void mnuFileExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void mnuImportFS_Click(object sender, EventArgs e)
        {
            try
            {
                StaticMethods.frmFileSystem1 = new frmFileSystem();
                StaticMethods.frmFileSystem1.MdiParent = this;
                StaticMethods.frmFileSystem1.Icon = this.Icon;
                StaticMethods.frmFileSystem1.Show();
            }
            catch (Exception ex)
            {              
                throw new Exception("Error opening frmFileSystem: " + ex.Message);
            }
        }

        private void mnuConvertMDB_Click(object sender, EventArgs e)
        {
            try
            {
                StaticMethods.frmConvertAccess1 = new frmConvertAccess();
                StaticMethods.frmConvertAccess1.MdiParent = this;
                StaticMethods.frmConvertAccess1.Icon = this.Icon;
                StaticMethods.frmConvertAccess1.Show();
            }
            catch (Exception ex)
            {

                throw new Exception("Error opening frmConvertAccess: " + ex.Message);
            }
        }

        private void dataToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void mnuCreateMetabase_Click(object sender, EventArgs e)
        {
            try
            {
                StaticMethods.frmNewDB1 = new frmNewDB();
                StaticMethods.frmNewDB1.MdiParent = this;
                StaticMethods.frmNewDB1.Icon = this.Icon;
                StaticMethods.frmNewDB1.Show();
            }
            catch (Exception ex)
            {
                throw new Exception("Error opening frmNewDB: " + ex.Message);
            }
        }

        private void mnuLoadMetabase_Click(object sender, EventArgs e)
        {
            try
            {
                StaticMethods.frmLoadMetabase1 = new frmLoadMetabase();
                StaticMethods.frmLoadMetabase1.MdiParent = this;
                StaticMethods.frmLoadMetabase1.Icon = this.Icon;
                StaticMethods.frmLoadMetabase1.Show();
            }
            catch (Exception ex)
            {
                throw new Exception("Error opening frmLoadMetabase: " + ex.Message);
            }
        }

        private void fromAccessMetabaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                StaticMethods.frmMetabaseImport1 = new frmMetabaseImport();
                StaticMethods.frmMetabaseImport1.MdiParent = this;
                StaticMethods.frmMetabaseImport1.Icon = this.Icon;
                StaticMethods.frmMetabaseImport1.Show();
            }
            catch (Exception ex)
            {
                throw new Exception("Error opening frmMetabaseImport: " + ex.Message);
            }
        }
    }
}
